<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>高校管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/college/baseCollege">高校列表</a></li>
		<shiro:hasPermission name="college:baseCollege:edit"><li><a href="${ctx}/college/baseCollege/form">高校添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="baseCollege" action="${ctx}/college/baseCollege" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>学校名称：</label>
				<form:input path="collegeName" htmlEscape="false" maxlength="255" class="input-medium"/>
			</li>
			<li><label>学校标识码：</label>
				<form:input path="collegeCode" htmlEscape="false" maxlength="255" class="input-medium"/>
			</li>
			<li><label>所属省：</label>
				<form:select path="provinceId" class="input-xlarge required">
					<form:option value="" label=""/>
					<form:options items="${fns:getProvinceList()}" itemLabel="provinceName" itemValue="id" htmlEscape="false"/>
				</form:select>
			</li>
			<li><label>分类：</label>
			<sys:treeselect id="baseCategory" name="categoryId" value="${baseCollege.categoryId}" labelName="baseCollege.categoryName" labelValue="${baseCollege.categoryName}"
					title="分类" url="/category/baseCategory/treeData?categoryTypeVal=2"   cssClass="required" allowClear="true"/>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>ID</th>
				<th>学校名称</th>
				<th>上线状态</th>
				<th>学校标识码</th>
				<th>所属省</th>
				<th>所在地</th>
				<th>办学层次</th>
				<th>分类名称</th>
				<th>更新时间</th>
				<shiro:hasPermission name="college:baseCollege:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="baseCollege">
			<tr>
				<td><a href="${ctx}/college/baseCollege/form?opt=detail&id=${baseCollege.id}">
					${baseCollege.id}
				</a></td>
				<td>
					${fns:getDictLabel(baseCollege.onlineStatus, 'online_status', '')}
				</td>
				<td>
					${baseCollege.collegeName}
				</td>
				<td>
					${baseCollege.collegeCode}
				</td>
				<td>
					${baseCollege.provinceName}
				</td>
				<td>
					${baseCollege.location}
				</td>
				<td>
					${baseCollege.level}
				</td>
				<td>
					${baseCollege.categoryName}
				</td>
				<td>
					<fmt:formatDate value="${baseCollege.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<shiro:hasPermission name="college:baseCollege:edit"><td>
    				<a href="${ctx}/college/baseCollege/form?id=${baseCollege.id}">修改</a>
    				<c:if test="${baseCollege.onlineStatus==1}">
    					<a href="${ctx}/college/baseCollege/save?id=${baseCollege.id}&onlineStatus=0" onclick="return confirmx('确认要下线该高校吗？', this.href)">下线</a>
    				</c:if>
    				<c:if test="${baseCollege.onlineStatus==0}">
    					<a href="${ctx}/college/baseCollege/save?id=${baseCollege.id}&onlineStatus=1" onclick="return confirmx('确认要上线该高校吗？', this.href)">上线</a>
    				</c:if>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>